package com.ojoin.trade.supplyloan_core.web.dao.impl;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.exception.DaoException;
import com.ojoin.trade.common.web.dao.impl.BaseDaoImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlAlipayInfoDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlAlipayInfo;
import org.springframework.stereotype.Repository;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 16-1-21
 * Time: 上午10:51
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class TbSlAlipayInfoDapImpl  extends BaseDaoImpl<TbSlAlipayInfo> implements TbSlAlipayInfoDao {
    @Override
    public TbSlAlipayInfo queryInfoByPlatform(int idOfPlatformUser) throws BusinessException {
        String mapMethodName = "selectByPlatform";
        try {
            return this.sqlSessionTemplate.selectOne(getSqlName(mapMethodName), idOfPlatformUser);
        } catch (Exception e) {
            throw new DaoException(String.format("根据平台查询支付宝的登陆账户记录出错！语句：%s",
                    getSqlName(mapMethodName)), e);
        }
    }
}
